package com.ygqh.baby.mapper;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.model.DrawReport;
import com.ygqh.baby.model.PrizeItem.Type;
import com.ygqh.baby.po.YgDrawPrizeRecord;
import com.ygqh.baby.po.YgDrawPrizeRecordExample;
import com.ygqh.baby.po.YgUserPrize;

public interface YgDrawPrizeRecordMapper {
	int countByExample(YgDrawPrizeRecordExample example);

	int deleteByExample(YgDrawPrizeRecordExample example);

	int deleteByPrimaryKey(Long id);

	int insert(YgDrawPrizeRecord record);

	int insertSelective(YgDrawPrizeRecord record);

	List<YgDrawPrizeRecord> selectByExample(YgDrawPrizeRecordExample example);

	YgDrawPrizeRecord selectByPrimaryKey(Long id);

	int updateByExampleSelective(@Param("record") YgDrawPrizeRecord record,
			@Param("example") YgDrawPrizeRecordExample example);

	int updateByExample(@Param("record") YgDrawPrizeRecord record, @Param("example") YgDrawPrizeRecordExample example);

	int updateByPrimaryKeySelective(YgDrawPrizeRecord record);

	int updateByPrimaryKey(YgDrawPrizeRecord record);

	int countSuper(@Param("q") String q);

	List<YgDrawPrizeRecord> selectSuper(@Param("queryInfo") QueryInfo queryInfo, @Param("q") String q);

	YgUserPrize selectMyGoodsPrize(@Param("userId") Long userId, @Param("sourceCode") String sourceCode);

	BigDecimal getGoodsPrizeCount(@Param("userId") Long userId, @Param("sourceCode") String sourceCode);

	int countByUserId(@Param("userId") Long userId, @Param("prizeType") Type prizeType,
			@Param("sourceCode") String sourceCode);

	BigDecimal getTotalRateByUserId(@Param("userId") Long userId, @Param("prizeType") Type prizeType,
			@Param("sourceCode") String sourceCode);

	List<DrawReport> getScanUserByDate(@Param("sourceCode")String sourceCode);

	List<DrawReport> getChangeProductByDate(@Param("sourceCode")String sourceCode);
	int getScanUserCount(@Param("sourceCode")String sourceCode);
	int totalUser(@Param("sourceCode")String sourceCode);
	int totalProduct(@Param("sourceCode")String sourceCode);
	int totalHelp(@Param("sourceCode")String sourceCode);
	int totalRegisterUser(@Param("sourceCode")String sourceCode);

}
